from PO.Page.Page import Page
from selenium.webdriver.common.by import By
# 页面类层
class Page2(Page):
    # 断言登录成功后的用户信息
    dy2_text=(By.XPATH,'/html/body/div[1]/div/div[1]/div/p/span')
    # 输入框
    text_loc = (By.ID, 'wd')
    # 搜索按钮
    sreach_loc = (By.CLASS_NAME, 'search-btn')

    dy3_text=(By.XPATH,'//*[@id="shopProId_46930"]/span')
    # 加入购物车
    shop_loc = (By.CLASS_NAME, 'cart sIcon prtlt_btn2')

    def dy2(self):
        return self.log_text('jxw225264768')

    def dy3(self):
        return self.log_text('酒淘酒类精品店')

    def text(self):
        self.send_keys(self.text_loc,'白云边')

    def sreach(self):
        self.click(self.sreach_loc)

    def shop(self):
        self.click(self.shop_loc)

    def jx_lj_02(self):
        print(self.dy2())
        self.text()
        self.sreach()
        print(self.dy3())
        self.shop()
